package com.scaffold.controller;

import com.scaffold.model.vo.UserPostVO;
import com.scaffold.model.vo.UserPutVO;
import com.scaffold.model.vo.UserVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Da Shuai
 * @since 2021-08-21 16:02:46
 */
@RequestMapping("/user")
public interface UserApi {

    @PostMapping
    UserVO save(@RequestBody @Validated UserPostVO postVO);

    @DeleteMapping
    void delete(Long id);

    @PutMapping
    UserVO update(@RequestBody @Validated UserPutVO putVO);

    @GetMapping
    UserVO get(@RequestParam Long id);

    @GetMapping("/list")
    List<UserVO> get();
}
